
def fib():
	a, b = 0, 1
	while True:
		n = a+b
		a, b = b, n
		yield n
		

i, f, s = fib(), 0, 0
while f<4000000:
	f = next(i)
	print(f)
	if(f%2==0):
		s += f

print(s)

